<template>
  <div class="conmmon-search">
    <van-search
      v-model="searchTitle"
      shape="round"
      placeholder="输入泊位、车牌号、手机号"
      class="xc-search"
      @search="emailSearch"
    />
    <div class="search-text" @click="getSearch">搜索</div>
  </div>
</template>
<script>
export default {
  data() {
    return {
      searchTitle: ""
    };
  },
  methods: {
    emailSearch() {
      this.$emit('search', this.searchTitle); // 添加事件触发
    },
    getSearch() {
      this.$emit('search', this.searchTitle);
    
    }
  }
};
</script>
<style lang="less" scoped>
.conmmon-search {
  width: 100%;
  height: 40px;
  touch-action: pan-y;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  background-color: white;
  .xc-search {
    width: 90%;
  }
  .search-text{
    font-size: 12px;
    color: #1989fa;
  }
}
/deep/ .van-search {
  background-color: transparent;
}
</style>
